{% extends "base.html" %}

{% block title %}项目列表{% endblock %}  

{% block content %}
	<ol class="breadcrumb">
  		<li class="active">项目</li>
	</ol>
	<div class="row">
		{% for project in data %}
            {% if project.item.status%}
            <div  class="col-sm-2 project_inactive">

				<div class="row">
                <span class="col-sm-10"><h3>{{ project.item.name }}</h3></span>
                    {% if perms.script.change_project%}
                    <a class="btn pull-right col-sm-2" data-toggle="tooltip" data-placement="bottom" title="激活项目" href="/autotester/project/active?id={{project.item.id}}"><span class="glyphicon glyphicon-pushpin"></span></a>
                    {% endif%}
                </div>
				<div class="row">
					<span>模块数:{{ project.module_total}}个</span>
					<span>API数:{{ project.api_total}}个</span>
				</div>
				<div class="row">
					<span>成功:<span class="success_font">({{ project.success}})</span>个</span>
					<span>失败:<span class="failure_font">({{ project.failure}})</span>个</span>
				</div>
			</div>
			
            {% else%}
            <div  class="col-sm-2 project">

				<div class="row"><a href="/autotester/project?id={{project.item.id}}"><h3>{{ project.item.name }}</h3></a></div>
				<div class="row">
					<span>模块数:{{ project.module_total}}个</span>
					<span>API数:{{ project.api_total}}个</span>
				</div>
				<div class="row">
					<span>成功:<span class="success_font">({{ project.success}})</span>个</span>
					<span>失败:<span class="failure_font">({{ project.failure}})</span>个</span>
				</div>
			</div>
            {% endif %}
		{% endfor %}
        {% if perms.script.add_project %}
		<a href="/autotester/project/create" class="col-sm-2 project btn btn-primary">
				<h1>+添加项目</h1>
		</a>
        {% endif %}
	</div>
{% endblock %}